<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
 <%
String loginid = request.getParameter("loginid");
Cookie[] cookies=request.getCookies(); //读出用户硬盘上的Cookie，并将所有的Cookie放到一个cookie对象数组里面
Cookie sCookie=null; 
String svalue=null; 
String sname=null; 
String cookieName = null;
String cookiepwd = null; 
if(null != cookies){
	for(int i=0;i<cookies.length;i++){    //用一个循环语句遍历刚才建立的Cookie对象数组
	sCookie=cookies[i];   //取出数组中的一个Cookie对象 
	sname=sCookie.getName(); //取得这个Cookie的名字
	svalue=sCookie.getValue(); //取得这个Cookie的内容
	if("chdname".equals(sname)){
		cookieName =  svalue;
	} 
	if("chdpwd".equals(sname)){
		cookiepwd =  svalue;
	} 
	}
}
boolean flag = false;
if(null == cookieName){ 
    cookieName = (String)request.getAttribute("username");
}else{
	flag = true;
}
if(null!= loginid && !"".equals(loginid)){
    cookieName = loginid;
}
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>


<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<%@ include file="include.jsp"%>  

 <script language="javascript" type="text/javascript" src="<%=path %>/thirtpart/highcharts216/highcharts.js"></script>
<script language="javascript" type="text/javascript" src="<%=path %>/thirtpart/highcharts216/modules/exporting.js"></script>

<% 
  String info = (String)request.getAttribute("alert");
  if(null == info)
     info = "";
  String userName = (String)request.getAttribute("username");
  if(null == userName){
     if(null != cookieName){
     	userName = cookieName;
     }else{
     	userName = "";
     }
  }
  session.invalidate();
%>
<script language=JavaScript>

function checkform()
{
if(isNull(document.LoginForm.UserName.value)){
  alert("请输入用户名～！");
  document.all.UserName.focus();
  return false;
}
if(isNull(document.LoginForm.Password.value)){
  alert("请输入密码～！");
  document.all.Password.focus();
  return false;
}
return true;
}
function isNull(pvalue)
 {
   var RegularExp=/^\s*$/;
   if(RegularExp.test(pvalue))
   {
     return true;
   }
   return false;
 }
function submitPage(){ 
    var LoginForm = document.forms[0];
    if(checkform()){
       LoginForm.submit();
    }
	
}
function isEntry(e){
     if(document.all)e = event;
     if(e.keyCode==13) {
             submitPage();
     };
}

</script>
</head>
<body>
 
 
<table width="100%" border="0" cellspacing="10" cellpadding="0" class="chart">
  <tr>
    <td width="33%">
        <p>现代期刊文献统计</p>
           	<div id="container" class="highcharts-container" style="margin-bottom:25px;height:100%; margin: 0 2em; clear:both; min-width: 300px"></div>

    </td>
    <td width="33%">
        <p>英文文献量统计</p>
        <div>图表区</div>
    </td>
    <td width="33%">
        <p>古籍文献量统计</p>
        <div>图表区</div>
    </td>
  </tr>
</table>
 
</body>
</html>
<script language="javascript" type="text/javascript">


var chart;
var chart1;
var chart2;
$(document).ready(function() {
   chart = new Highcharts.Chart({
      chart: {
            renderTo: 'container',
            type: 'column',
            margin: [ 0, 0, 0, 0] ,
            width:300,
            height:200
        },
        title: {
             text: ''
        },
        xAxis: {
            categories: ['2001','2003','2005','1995','1999'],
            labels: {
                rotation: -45,
                align: 'right',
                style: {
                    font: 'normal 13px Verdana, sans-serif'
                }
            }
        },
        yAxis: {
            min: 0,
            title: {
                text: '文献数量'
            }
        },
        legend: {
            enabled: false
        },
        tooltip: {
            formatter: function() {
                return '<b>'+ this.x +'</b>年<br/>'+
                    ' 中文现代期刊文献共: '+ Highcharts.numberFormat(this.y, 0) +
                    ' 篇';
            }
        },
            series: [{
            name: '文献量',
            data: [1,1,1,180,131],
            color: '#d27433', 
            borderColor:  '#d27433',
            borderRadius:'5', 
            dataLabels: {
                enabled: true,
                rotation: -90,
                color: '#FFFFFF',
                align: 'right',
                x: -3,
                y: 10,
                formatter: function() {
                    return this.y;
                },
                style: {
                    font: 'normal 13px Verdana, sans-serif'
                }
            }
        }]
    });
});

</script>